import serial
import time
import redis

if __name__ == "__main__":
    ser = serial.Serial('/dev/ttyUSB1')

    # r = redis.Redis(db=0, password='lwj380279011', host='117.185.46.193', socket_timeout=1)
    # r.set('pole_status', 'off')

    time_stamp = time.time()
    current_status = 'off'

    while True:
        try:
            # status = r.get('pole_status').decode("utf-8")

            ser.write(b'*ASK#')
        except:
            print('error')

        time.sleep(1.2)